<template>
  <div class="lg:flex">
    <Avatar :src="headerImg" :size="72" class="!mx-auto !block" />
    <div class="md:ml-6 flex flex-col justify-center md:mt-0 mt-2">
      <h1 class="md:text-lg text-md">Hi, {{ userinfo?.userName }}, 开始您一天的工作吧！</h1>
      <Icon icon="ant-design:sync-outlined" :size="20" @click="reloadFn" />
      <span style="font-size: 12px; color: gray; margin-top: 5px"
        >版本号:1.0.1 | 版本更新时间:2024-10-09</span
      >
      <!--      <span class="text-secondary"> 今日晴，20℃ - 32℃！ </span> -->
    </div>
    <div class="flex flex-1 justify-end md:mt-0 mt-4">
      <div class="flex flex-col justify-center text-right" style="cursor: pointer">
        <span class="text-secondary"> 费用待处理 </span>
        <span class="text-2xl" style="color: red" @click="goMouldView">{{
          dataList.mouldWait
        }}</span>
      </div>

      <!--      <div class="flex flex-col justify-center text-right md:mx-16 mx-12">-->
      <!--        <span class="text-secondary"> 项目 </span>-->
      <!--        <span class="text-2xl">8</span>-->
      <!--      </div>-->
      <!--      <div class="flex flex-col justify-center text-right md:mr-10 mr-4">-->
      <!--        <span class="text-secondary"> 团队 </span>-->
      <!--        <span class="text-2xl">300</span>-->
      <!--      </div>-->
    </div>
  </div>
</template>
<script lang="ts" setup>
  import { computed, onMounted, ref } from 'vue';
  import { Avatar } from 'ant-design-vue';
  import { useUserStore } from '@/store/modules/user';
  import headerImg from '@/assets/images/header.jpg';
  import { waitListApi } from '@/api/sys/sysData';
  import { useMessage } from '@/hooks/web/useMessage';
  import { useGo } from '@/hooks/web/usePage';
  import Icon from '@/components/Icon/Icon.vue';

  const userStore = useUserStore();
  const userinfo = computed(() => userStore.getUserInfo);
  const { createMessage } = useMessage();
  const go = useGo();

  onMounted(() => {
    // console.log("---props.dateObj:",props.dateObj)
    searchFn();
  });

  const dataList = ref({});
  function searchFn() {
    let data = {};
    // waitListApi().then((res) => {
    //   if (res.code == 200) {
    //     dataList.value = res.data;
    //   } else {
    //     createMessage.error(res.message);
    //   }
    // });
  }

  function goMouldView() {
    go('/ms/mouldList');
  }

  function reloadFn() {
    window.location.reload();
  }
</script>
